package com.lyf;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.sql.Connection;
import java.sql.SQLException;

public class test2 {
    @Test
    public void test() throws SQLException {
        ApplicationContext ac = new ClassPathXmlApplicationContext("/application.xml");
        Connection con = (Connection) ac.getBean("con");
        Connection con2 = (Connection) ac.getBean("con");
        Connection con3 = (Connection) ac.getBean("con");
        System.out.println(con==con2);
        System.out.println(con==con3);
    }
}
